import MultiplePicSelect from "@/components/SurveyComs/MaterialItems/ChooseComs/MultiplePicSelect.vue";

// + 编辑组件
import TitleEditor from "@/components/SurveyComs/EditItems/TitleEditor.vue";
import { v4 as uuidv4 } from "uuid";
import DescEditor from "@/components/SurveyComs/EditItems/DescEditor.vue";
import PositionEditor from "@/components/SurveyComs/EditItems/PositionEditor.vue";
import SizeEditor from "@/components/SurveyComs/EditItems/SizeEditor.vue";
import WeightEditor from "@/components/SurveyComs/EditItems/WeightEditor.vue";
import ItaticEditor from "@/components/SurveyComs/EditItems/ItaticEditor.vue";
import ColorEditor from "@/components/SurveyComs/EditItems/ColorEditor.vue";
import type { IJsonSchema } from "@/types/common";
import TitleDevider from "@/components/SurveyComs/EditItems/Common/TitleDevider.vue";
import PicOptionsEditor from "@/components/SurveyComs/EditItems/PicOptionsEditor.vue";

// + 记录 【单选题】 所有的默认状态
export default function (): IJsonSchema {
  return {
    // - 组件
    type: markRaw(MultiplePicSelect),
    // - 名称
    name: "multiple-pic-select",
    // - 唯一id
    id: uuidv4(),
    // * 组件状态
    // ? 业务组件的每一个可修改的项都对应一个编辑组件
    status: {
      // * 标题
      title: {
        // - 唯一id
        id: uuidv4(),
        // - 状态（值）
        status: "多选图片默认标题",
        // - 是否显示
        isShow: true,
        // - 名称
        name: "title-editor",
        // - 编辑组件
        editCom: markRaw(TitleEditor),
      },
      // * 描述
      desc: {
        id: uuidv4(),
        status: "多选图片默认描述",
        isShow: true,
        name: "desc-editor",
        editCom: markRaw(DescEditor),
      },
      // * 选项
      options: {
        id: uuidv4(),
        status: [
          {
            picTitle: "图片标题1",
            picDesc: "图片描述1",
            value: "",
          },
          {
            picTitle: "图片标题2",
            picDesc: "图片描述2",
            value: "",
          },
        ],
        currentStatusIndex: 0,
        isShow: true,
        name: "pic-options-editor",
        editCom: markRaw(PicOptionsEditor),
      },
      // * 居中设置
      position: {
        id: uuidv4(),
        status: [
          { label: "左对齐", value: "left" },
          { label: "居中对齐", value: "center" },
          { label: "右对齐", value: "right" },
        ],
        currentStatusIndex: 0,
        isShow: true,
        name: "position-editor",
        editCom: markRaw(PositionEditor),
      },
      // ? 标题分割线
      titleDevider: {
        id: uuidv4(),
        status: "标题设置",
        isShow: true,
        name: "title-devider-editor",
        editCom: markRaw(TitleDevider),
      },
      // * 标题尺寸
      titleSize: {
        id: uuidv4(),
        status: ["22", "20", "18"],
        currentStatusIndex: 0,
        isShow: true,
        name: "size-editor",
        editCom: markRaw(SizeEditor),
      },
      // * 标题字体粗细
      titleWeight: {
        id: uuidv4(),
        status: [
          { label: "粗体", value: "700" },
          { label: "正常", value: "400" },
          { label: "细体", value: "100" },
        ],
        currentStatusIndex: 1,
        isShow: true,
        name: "weight-editor",
        editCom: markRaw(WeightEditor),
      },
      // * 标题倾斜
      titleItatic: {
        id: uuidv4(),
        status: ["正常", "倾斜"],
        currentStatusIndex: 0,
        isShow: true,
        name: "italic-editor",
        editCom: markRaw(ItaticEditor),
      },
      // * 标题颜色
      titleColor: {
        id: uuidv4(),
        status: "#000",
        isShow: true,
        name: "color-editor",
        editCom: markRaw(ColorEditor),
      },
      // ? 描述分割线
      descDevider: {
        id: uuidv4(),
        status: "描述设置",
        isShow: true,
        name: "desc-devider-editor",
        editCom: markRaw(TitleDevider),
      },
      // * 描述尺寸
      descSize: {
        id: uuidv4(),
        status: ["16", "14", "12"],
        currentStatusIndex: 0,
        isShow: true,
        name: "size-editor",
        editCom: markRaw(SizeEditor),
      },
      // * 描述字体粗细
      descWeight: {
        id: uuidv4(),
        status: [
          { label: "粗体", value: "700" },
          { label: "正常", value: "400" },
          { label: "细体", value: "100" },
        ],
        currentStatusIndex: 1,
        isShow: true,
        name: "weight-editor",
        editCom: markRaw(WeightEditor),
      },
      // * 描述倾斜
      descItatic: {
        id: uuidv4(),
        status: ["正常", "不倾斜"],
        currentStatusIndex: 0,
        isShow: true,
        name: "italic-editor",
        editCom: markRaw(ItaticEditor),
      },
      // * 描述颜色
      descColor: {
        id: uuidv4(),
        status: "#000",
        isShow: true,
        name: "color-editor",
        editCom: markRaw(ColorEditor),
      },
    },
  };
}
